package ErChaShu;

/**
 * 哈夫曼树节点类
 */
public class HuffmanNode {
    /**
     * 字符值
     */
    char data;
    /**
     * 字符出现的频率(权重)
     */
    int frequency;
    /**
     * 左孩子节点
     */
    HuffmanNode left;
    /**
     * 右孩子节点
     */
    HuffmanNode right;

    /**
     * @param data      节点字符
     * @param frequency 字符出现频率(权重)
     */
    public HuffmanNode(char data, int frequency) {
        this.data = data;
        this.frequency = frequency;
    }
}

